package icom.acm.action;

import icom.acm.bean.T_USER;
import icom.acm.util.json.JSONMsg;

public class TokenAction extends Action{
	
	public void createToken(){
		JSONMsg jmsg = null;
		
		T_USER user = checkUser();
		if (user==null) {
			jmsg = new JSONMsg(Boolean.FALSE, "用户未登陆！");
			out.print(jmsg.toString());
			return ;		
		}		
		
		String token = java.util.UUID.randomUUID().toString();
		session.setAttribute("token", token);
		jmsg = new JSONMsg(Boolean.TRUE, token);
		out.print(jmsg.toString());		
	}		
}